// function * foo () {
//     console.log('start')
// }

// const generater = foo()

// generater.next()

const MyPromise = require('./myPromise');


const myPromise = new MyPromise((resolve, reject) => {
    // resolve('成功');
    reject('失败');
})

// myPromise.then(value => {
//     console.log(value);
//     return 100;
// }, reason => {
//     console.log(reason);
// }).then(value => {
//     console.log(value);
// })

myPromise.then().then().then(value => console.log(value), reason => console.log(reason));